package com.beecloud.microservice.user.domain.error;

import java.io.Serializable;

public class ErrorInfo implements Serializable {

	private static final long serialVersionUID = -8635548663243250139L;

	private String description = null;

	private int code = -1;

	private boolean recoverable = false;


	// MoRouter Error Codes Starting from 4001
    public static final ErrorInfo MOROUTER_ERROR_HANDLING_MESSAGE = new ErrorInfo(
			3001, "Error in Queuing a message", false);

	public static final ErrorInfo MOROUTER_ERROR_HANDLING_MESSAGE_1 = new ErrorInfo(
			3002, "Error in Queuing a message", false);

	private ErrorInfo(int errorCode, String errorInfo, boolean recoverable) {
		code = errorCode;
		description = errorInfo;
		this.recoverable = recoverable;
	}

	public boolean isRecoverable() {
		return recoverable;
	}

    @Override
    public String toString() {
        return description;
    }

    public int getCode() {
		return code;
	}

	public String getDescription() {
		return description;
	}
}